<script setup>
import { inject } from 'vue'

const xxx = inject('money')
const setMoney = inject('setMoney')
</script>

<template>
  <div class="son-page">
    我是子组件:{{ xxx }}

    <button @click="setMoney(50)">修改money</button>
  </div>
</template>

<style scoped>
.son-page {
  width: 300px;
  height: 300px;
  border: 5px solid red;
}
</style>
